package request

import "time"

type PhoneVo struct {
	Phone string `form:"phone" json:"phone" binding:"required,mobile"`
	Code  string `form:"code"  json:"code"  binding:"required"`
}

type UsernameVo struct {
	Username string `form:"username" json:"username" binding:"required"`
	Password string `form:"password" json:"-" binding:"required"` //永远不会返回密码json给前端
}

type PhoneCodeVo struct {
	Phone string `form:"phone" json:"phone" binding:"required,mobile"`
	Code  string `form:"code" json:"code" binding:"required"`
}

type UserInfoVo struct {
	Username string    `json:"username"`
	Password string    `json:"password"`
	Email    string    `json:"email"`
	Gender   string    `json:"gender"`
	Birthday time.Time `json:"birthday"`
	Phone    string    `json:"phone"`
}

func (p PhoneVo) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"phone.required": "手机号不能为空",
		"phone.mobile":   "手机号格式不正确",
		"code.required":  "验证码不能为空",
	}
}

func (u UsernameVo) GetMessages() ValidatorMessages {
	return ValidatorMessages{
		"username.required": "用户账号不能为空",
		"password.required": "用户密码不能为空",
	}
}
